package com.hongmeng.teamwork.enums;

public enum TaskPriorityEnum {
    LOWEST(0, "最低"),
    LOW(1, "较低"),
    NORMAL(2, "普通"),
    HIGH(3, "较高"),
    HIGHEST(4, "最高"),
    ;

    private int code;
    private String desc;

    TaskPriorityEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static TaskPriorityEnum ofEnum(int code) {
        for (TaskPriorityEnum taskPriorityEnum : TaskPriorityEnum.values()) {
            if (taskPriorityEnum.code == code) {
                return taskPriorityEnum;
            }
        }
        return null;
    }
}
